const app = getApp();
const http = require('../../../utils/util.js');
const mta = require('../../../mta_sdk/mta_analysis.js');
Page({

  data: {
    baseImg: '',
    imgBig: '',
    inputValue: '',
    pid:''
  },

  onLoad: function (opt) {
    mta.Page.init();
    console.log(opt);
    if (opt.pid) {
      this.setData({
        baseImg: `/images/${opt.pid}_list.jpg`,
        imgBig: `/images/${opt.pid}_canvas.jpg`,
        pid: opt.pid
      })
    }
  },
  formSubmit: function (e) {
    app.sendForm(e);
  },
  getInputValue: function (e) {
    this.setData({
      inputValue: e.detail.value
    })
  },
  toShowImg() {
    if (this.data.inputValue == '') {
      wx.showToast({
        title: '请输入内容',
        icon: 'none'
      });
      return false;
    }

    wx.navigateTo({
      url: `/pages/tz/tz_detail/tz_detail?txt=${this.data.inputValue}&imgUrl=${this.data.imgBig}&pid=${this.data.pid}`,
    })
  },
  onUnload() {
    wx.removeStorageSync("coverpic")
  },
  onShareAppMessage: function () {
    return {
      title: '家长通知书制作',
      desc: '家长通知书制作',
      path: `/pages/index/index`,

    }
  }
})